<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								电梯名称：<input type="text" name="elevatorName"/>
							</li>
							<li>
								使用单位：<input type="text" name="useUnit"/>
							</li>
							<li>
								维保单位：<input type="text" name="serverUnit"/>
							</li>
							<li>
								事件类型：
								<select name="eventType" th:with="type=${@dict.getType('business_event_type')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:elevatorEvent:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:elevatorEvent:remove')}]];
		var eventType = [[${@dict.getType('business_event_type')}]];
        var prefix = ctx + "business/elevatorEvent";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "电梯事件",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'eventId', 
					title : '事件ID',
					visible: false
				},
				{
					title: "序号",
					formatter: function (value, row, index) {
						return $.table.serialNumber(index);
					}
				},
				{
					field : 'elevatorId', 
					title : '关联电梯ID',
                    visible: false
				},
				{
					field : 'eventCode', 
					title : '事件单号'
				},
				{
					field : 'elevatorName', 
					title : '电梯名称'
				},
				{
					field : 'eventType', 
					title : '事件类型',
					formatter:function (value, row, index) {
						return $.table.selectDictLabel(eventType, value);
					}
				},
				{
					field : 'reportTime', 
					title : '上报时间',
					sortable: true
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>